	<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="/resource/UserPwoer.tld" prefix="p"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	pageContext.setAttribute("fnId", request.getAttribute("fnId"));
	pageContext.setAttribute("userPwoer", request.getSession().getAttribute("userPwoer"));
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
</head>
<body class="gray-bg">
	<nav class="huiNav">
		<%@include file="project-nav.jsp" %>项目总结
		<a class="btn btn-info  btn-sm pull-right"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="fa fa-refresh"></i></a>
	</nav>

	<div class="ibox-content">
	<%-- <jsp:include page="proj-manager-son.jsp"></jsp:include> --%>
	<!-- 搜索框部分start -->
	<div class="row">
		<div class="col-sm-9">
			<form class="form-inline" id="serchform">
			
			<%-- <label for="exampleInputName2">角色</label>
			<div class="form-group mr-20">
					<div class="col-sm-4 ">
						<select name="roleId" class="  form-control autoFull"
							style="width: 200px" data-url="${path}/admin/role/showList"
							data-filed="name" data-value="id">
							<option value="">--请选择角色--</option>
						</select>
					</div>
			</div> --%>
			<input type="hidden" id="projId" value="${obj.id}">
			<br>
			<div class="form-group mr-20">
				<label for="exampleInputName2">文件状态</label>
				<select name="status" id="status" class="form-control"> 
					<option value="">----请选择----</option>
					<option value="已阅读">已阅读</option>
					<option value="未阅读">未阅读</option>
				 </select>
			</div>
		
			<button  onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search " ></i> 搜索</button>
			<button  type="reset" class="btn btn-info btn-sm"><i class="fa fa-refresh " ></i> 重置</button>
		</form>
		</div>
		<div class="col-sm-3">
			<div class="btn-group">
			  <button type="button" class="btn btn-default" onclick="getA()">我发出的</button>
			  <button type="button" class="btn btn-primary" onclick="getB()">我收到的</button>
			</div>
		</div>
	</div>
		
		
		
	<!-- 搜索框部分en -->
		<!--  <div class="" >
			<button onclick="myGrid.delItems()" type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash" ></i>批量删除</button>
			<button onclick="openAdd()" type="button" class="btn btn-success btn-sm"><i class="fa fa-plus" ></i>  新增</button>
		</div>  -->
		<div class="row">
			<div class="col-md-12" >
			<table id="mgrid" >
				<thead>
					<tr>
						<th data-checkbox="true"  ></th>
						<th data-formatter="MGrid.indexfn" data-align="center"  data-width="30px" >序号</th>
						<th data-field="title" >标题</th>
						<th data-field="commitTime" data-formatter="MGrid.getTime" data-sortable="true" >提交时间</th>
						<th data-field="userName" >发送人</th>
						<th data-field="status" >阅读状态</th>
						<th data-align="center"  data-width="150px" data-field="id" data-formatter="buidOperate">操作</th>
					</tr>
				</thead>
			</table>
			</div>
		</div> 
	</div>
	
	
	<a href="${path}/admin/"></a>
	<script type="text/javascript">
/* 	$(function(){
		var html="<option value=''>--请选择角色--</option>	";
		$.AjaxProxy({a : false,c : false}).invoke("${path}/admin/projectText/postNameList",function(loj){
			for(var i = 0; i < loj.getRowCount(); i++){	
				html=html+"<option value='"+loj.getString(i,"id")+"'>"+loj.getString(i,"postName")+"</option>	"
			}
			$("#s1").empty().html(html);
		 })
	}) */
	
	var myGrid;
		$(function(){
			var delUrl="";
				delUrl="${path}/admin/sendReport/del";
			 myGrid=MGrid.initGrid({
			 	 url:"${path}/admin/sendReport/showList",
				 delUrl:delUrl,
			 });
			
		});
		
		function buidOperate(value, row, index){
		/* 	$.AjaxProxy({a : false,c : false,p:{id:value}}).invoke("${path}/admin/sendReport/queryFileUrl",function(loj){
				info=loj.attr('result').info;
			}) */
			var html='';
			if(row.report.fileUrl != null && row.report.fileUrl!=""){
				html+='<a class="btn btn-default btn-sm mr-5" href="'+row.report.fileUrl+'" title="下载附件"><i class="glyphicon glyphicon-download"></i></a>';
			}
			
			html+='<button class="btn btn-default btn-sm mr-5" onClick="openEdit('+value+')" title="查看"><i class="fa fa-lg fa-eye"></i></buttoun>';
			return html; 
		}
	/* 	//打开添加界面
		function openAdd() {
			layer.open({
				type : 2,
				title : "添加报告",
				area : [ MUI.SIZE_L, '400px' ],
				content : [ '${path}/admin/report/editForm?projId='+$("#projId").val()]
			}); 
		}  */
		//打开编辑界面
		function openEdit(id) {
			layer.open({
				type : 2,
				title : "查看报告",
				area : [ MUI.SIZE_L, '400px' ],
				maxmin : true,
				content : [ '${path}/admin/sendReport/editForm?id=' +id],
				end:function(){
					MTools.redirect("${path}/admin/sendReport/sendReport?id="+$("#projId").val());
				}
			});
			
		} 
 	//我发出
		function getA(){
			MTools.redirect("${path}/admin/report/report?id="+$("#projId").val());
		}
		//我获取	
		function getB(){
			MTools.redirect("${path}/admin/sendReport/sendReport?id="+$("#projId").val());
		}
		
	/* 	function download(id){
			MTools.redirect("${path}/admin/projectText/download?id="+id);
		} */
		
		//重置密码
		/* function resetPass(id){
			layer.msg('重置后密码为【123】确定重置密码吗？', {
				  time: 0 ,
				  icon:3,
				  btn: ['确定', '取消'],
				  yes: function(index){
				     layer.close(index);
				    //*把密码设置为123
					$.AjaxProxy(
							{a : false,
							 c : false,
							 p:{id:id}}).invoke("${path}/admin/resetPassword",function(loj){
						if(loj.attr("result").status=='ok'){
							layer.msg("密码重置成功",{icon:1});
						}
					});
					
				  }
				});
			
		} */
		//
	</script>
</body>
</html>
